<?php 
require 'dbconnect.php';
session_start();
if(isset($_SESSION['access'])){
$page = ($_SESSION['access'] == 0) ? 'studentmasterpage.php' : 'facultymasterpage.php';
include $page;
}
else{
echo $_SESSION['name'];
echo $_SESSION['access'];
echo "the session isnt working";
}
$myid = $_SESSION['id'];
$result = mysql_query("SELECT C.CourseName, C.SectionNo, CS.Semester, CS.Location, CS.Capacity, CS.CourseScheduleID FROM Course C, CourseSchedule CS WHERE C.CourseID = CS.CourseID AND CS.FacultyID = $myid") or die(mysql_error());
echo "<table border = '5'><tr><td>Course Name</td><td>Section Number</td><td>Semester</td><td>Location</td><td>Capacity</td><td>Update Grades</td></tr>";
while($row = mysql_fetch_array($result)){
echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td>$row[3]</td><td>$row[4]</td><td><a href='update.php?id=$row[5]'>Update Grades</a></td></tr>";
}
echo "</table>";
include 'footer.php';
?>